#pragma once
#include <widgets/SDialog.h>
#include <QStylePainter>
#include <vector>
#include "../data/TreasuryFuturesData.h"

class FixedNatFutureHandler;
class TreasuryFuturesList;
class TreasuryFuturesChart;
class TreasuryFutures : public SDialog
{
	Q_OBJECT
public:
	TreasuryFutures(QWidget* p);
	~TreasuryFutures();

protected:
	virtual SDialog* clone(QWidget* parent = nullptr) override;
	void timerEvent(QTimerEvent* event) override;

protected slots:
	void onDataResponse(int funcId);
	void onClickedTFListRow(const QString& TFId);
	void onCTDChanged();

private:
	void reloadData();
	void refreshTFList();
	void refreshTFChart();

private:
	CFixedNatFutureData m_data;
	FixedNatFutureHandler* m_TFDataHandler = nullptr;
	TreasuryFuturesList* m_list = nullptr;
	TreasuryFuturesChart* m_chart = nullptr;
	volatile bool m_dataDirty = false;

};